🎖️GitЯра🎖️
.github/agents/speckit.git.validate.agent.md f1c793db5de3df9e987de16ddcda23f3757ba3db (f1c793db) Text, 1.84 KB
description: Validate current branch follows feature branch naming conventions
<!-- Extension: git -->
<!-- Config: .specify/extensions/git/ -->
Validate Feature Branch
Validate that the current Git branch follows the expected feature branch naming conventions.
Prerequisites
• Check if Git is available by running T383838git rev-parse --is-inside-work-tree 2>/dev/null
• If Git is not available, output a warning and skip validation:
T282828
[specify] Warning: Git repository not detected; skipped branch validation
Validation Rules
Get the current branch name:
T282828
git rev-parse --abbrev-ref HEAD
The branch name must match one of these patterns:
1. Sequential: T383838^[0-9]{3,}- (e.g., T383838001-feature-name, T383838042-fix-bug, T3838381000-big-feature)
2. Timestamp: T383838^[0-9]{8}-[0-9]{6}- (e.g., T38383820260319-143022-feature-name)
Execution
If on a feature branch (matches either pattern):
• Output: T383838✓ On feature branch: <branch-name>
• Check if the corresponding spec directory exists under T383838specs/:
• For sequential branches, look for T383838specs/<prefix>-* where prefix matches the numeric portion
• For timestamp branches, look for T383838specs/<prefix>-* where prefix matches the T383838YYYYMMDD-HHMMSS portion
• If spec directory exists: T383838✓ Spec directory found: <path>
• If spec directory missing: T383838⚠ No spec directory found for prefix <prefix>
If NOT on a feature branch:
• Output: T383838✗ Not on a feature branch. Current branch: <branch-name>
• Output: T383838Feature branches should be named like: 001-feature-name or 20260319-143022-feature-name
Graceful Degradation
If Git is not installed or the directory is not a Git repository:
• Check the T383838SPECIFY_FEATURE environment variable as a fallback
• If set, validate that value against the naming patterns
• If not set, skip validation with a warning
Served by rngit 1.5.2 - Generated in 0.08s